﻿using System.Collections.Generic;

namespace HanoiSimulator
{
    class Hanoi
    {
        private List<string> stepList;

        public Hanoi() { stepList = new List<string>(); }

        public void Solve(int n, string a = "A", string b = "B", string c = "C")
        {
            if (n == 1)
            {
                stepList.Add(string.Format("{2}号 {0} -> {1}", a, c, n));
            }
            else
            {
                Solve(n - 1, a, c, b);
                stepList.Add(string.Format("{2}号 {0} -> {1}", a, c, n));
                Solve(n - 1, b, a, c);
            }
        }
        public string[] GetStepArray() { return stepList.ToArray(); }
    }
}
